#ifndef _SUPER_H
#define _SUPER_H

#include <cnix/types.h>
#include <cnix/wait.h>
#include <cnix/inode.h>
#include <cnix/filesystem.h>

struct super_block;

struct super_block{
	struct inode * s_rooti;	 // its root inode
	struct inode * s_mounti; // the inode it's mounted on if it's mounted

	int s_count;		// increment in mount, decrement in umount
	unsigned short s_flags;	// LOCK_S, WANT_S, LOCK_BITOP, WANT_BITOP
       	struct wait_queue * s_wait;
	struct wait_queue * s_bitop_wait;

	dev_t s_dev;

	BOOLEAN s_roflag;

	struct filesystem * s_filesystem;
	void * s_data;
};

#define LOCK_S		01
#define WANT_S		02
#define LOCK_BITOP	04
#define WANT_BITOP	010

extern void init_super(void);
extern void sfree(struct super_block * sb);
extern struct super_block * sread(dev_t dev);
extern struct super_block * get_sb(dev_t dev);

#endif
